const Koa = require("./kkb");
const Router = require("./router");
const app = new Koa();
const router = new Router();

const static = require('./static')
app.use(static(__dirname + '/public'));

router.get("/index", async (ctx) => {
  console.log("index,xx");
  ctx.body = "index page";
});
router.get("/post", async (ctx) => {
  ctx.body = "post page";
});
router.get("/list", async (ctx) => {
  ctx.body = "list page";
});
router.post("/index", async (ctx) => {
  ctx.body = "post page";
});
// 路由实例输出⽗中间件 router.routes()
app.use(router.routes());

app.use(require("./iptable.js"));
app.listen(3000, '0.0.0.0', () => {
 console.log("监听端⼝3000");
});
